<?php
namespace app\erp\validate;
use think\Validate;
class Adventrule extends Validate{
    protected $rule = [
        'advent_name' => 'require|unique:advent,advent_name^partner_id',
        'advent_url' => 'require',
        'sort'=> 'require|number'
    ];
    
    protected $message = [
        'advent_name.require' => '广告标题必须填写',
        'advent_name.unique' => '广告标题已存在',
        'advent_url.require' => '广告链接必须填写',
        'sort.require' => '排序不能为空',
        'sort.number' => '排序只能是数字'
    ];
    protected $scene = [
        'edit' => [
            'advent_name' => 'unique:advent,advent_name^partner_id',
            'sort' => 'number'
        ]
    ];
}